"""
BreakerPlayer.py

Author: Zach Epolito
Date: 9-22-08

$Id: BreakerPlayer.py 324 2008-10-17 02:18:09Z malerba89 $
"""

from HumanBreakerPlayer import HumanBreakerPlayer
from RandCompBreakerPlayer import RandCompBreakerPlayer
from NetworkBreakerPlayer import NetworkBreakerPlayer

"""Imitates a Maker player and has a reference to
   the different maker strategies.
"""
class BreakerPlayer:

    #types of strategies
    HUMAN = 0
    COMPUTER = 1
    NETWORK = 2

    """Constructor. Sets which strategy is being used.
    Only human strategy is currently available.
    """
    def __init__(self, game, host, gui, stratType, waitTime):
        self.game = game
        self.host = host
        self.gui = gui
        self.stratType = stratType
        self.waitTime = waitTime
        
        self.setStrat(stratType)

    """Sets the strategy
    """
    def setStrat(self, stratType):
        if (stratType == self.HUMAN):
            self.strat = HumanBreakerPlayer(self.game, self.host, self.gui, self.waitTime)
        if (stratType == self.NETWORK):
            self.strat = NetworkBreakerPlayer(self.game, self.host, self.gui, self.waitTime)
        if (stratType == self.COMPUTER):
            self.strat = RandCompBreakerPlayer(self.game, self.host, self.gui, self.waitTime)

    def getStrat(self):

        return self.strat
